package com.ayoka.parenting.adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.ayoka.parenting.R;
import com.ayoka.parenting.bean.BasicUserInfoBean;
import com.ayoka.parenting.bean.StudentBean;
import com.jincp.common.brvah.BaseQuickAdapter;
import com.jincp.common.brvah.BaseViewHolder;
import com.jincp.common.utils.StringUtil;
import com.jincp.image.load.ImageLoader;
import com.jincp.image.load.ImageLoaderOptions;


/**
 * @ProjectName: ayoka7.
 * @ClassName: CourseClassroomMemberAdapter.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/8/6 21:15.
 */

public class CareStudentAdapter extends BaseQuickAdapter<StudentBean, BaseViewHolder> {


    public CareStudentAdapter() {
        super(R.layout.item_care_student);
    }

    @Override
    protected void convert(BaseViewHolder holder, StudentBean item) {
        if (item.StudentInfo != null) {
            if (item.StudentInfo.BasicInfo != null) {
                ImageLoader.getInstance().displayImage(item.StudentInfo.BasicInfo.LocalAvatar, (ImageView) holder.getView(R.id.iv_user_header), ImageLoaderOptions.getCircleOptions());
                holder.setText(R.id.tv_user_name, item.StudentInfo.BasicInfo.WeixinNickName);
            }
            holder.setText(R.id.tv_continue_days, StringUtil.formatString(R.string.format_continue_days, item.StudentInfo.MeditationContinuouDays))
                    .setText(R.id.tv_total_meditation_times, StringUtil.formatString(R.string.format_total_meditation_times, item.StudentInfo.MeditationTotalCount))
                    .setText(R.id.tv_care, item.Status == 0 ? R.string.care : R.string.cared);
        }
    }
}
